package com.ly;

import com.alibaba.fastjson.JSON;
import com.ly.entity.Bbook;
import com.ly.service.BbookService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.List;

@SpringBootApplication(scanBasePackages = {"com.ly.controller","com.ly.service"})
@MapperScan(basePackages ={"com.ly.dao"})
public class Springboot01Application implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(Springboot01Application.class, args);
		System.out.println("131");

	}

	@Autowired
	BbookService bbookService;

	@Override
	public void run(String... args) throws Exception {
		List<Bbook> bbooks = bbookService.selectByCondition(new Bbook());
		System.out.println(JSON.toJSONString(bbooks));
	}
}
